package com.smartmedical.patient.sickcricle.service.impl;

import com.smartmedical.common.core.domain.HealthR;
import com.smartmedical.patient.sickcricle.dto.SickCircleDto;
import com.smartmedical.patient.sickcricle.mapper.SickCircleMapper;
import com.smartmedical.patient.sickcricle.service.SickCircleService;
import com.smartmedical.patient.sickcricle.service.SickCollectionService;
import com.smartmedical.patient.sickcricle.vo.SickCircleCommentVo;
import com.smartmedical.patient.sickcricle.vo.SickCircleDetailVo;
import com.smartmedical.patient.sickcricle.vo.SickCirclePublishVo;
import com.smartmedical.patient.sickcricle.vo.SickCircleVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SickCircleServiceImpl implements SickCircleService {


    @Autowired
    private SickCircleMapper sickCircleMapper;


    @Override
    public HealthR<List<SickCircleVo>> findSickCircleList(Integer departmentId) {
        List<SickCircleVo> sickCircleList = sickCircleMapper.findSickCircleList(departmentId);
        return HealthR.ok(sickCircleList);

    }




    @Override
    public SickCircleDetailVo findSickCircleInfo(Integer sickCircleId) {
        SickCircleDetailVo sickCircleInfo = sickCircleMapper.findSickCircleInfo(sickCircleId);
        return sickCircleInfo;
    }







    @Override
    public HealthR<List<SickCircleVo>> searchSickCircle(String keyword) {
        List<SickCircleVo> sickCircleVos = sickCircleMapper.searchSickCircle(keyword);
        return HealthR.ok(sickCircleVos);

    }






    @Override
    public HealthR<List<SickCircleCommentVo>> findSickCircleCommentList(Integer sickCircleId) {
        List<SickCircleCommentVo> sickCircleCommentList = sickCircleMapper.findSickCircleCommentList(sickCircleId);
        return HealthR.ok(sickCircleCommentList);

    }





    @Override
    public HealthR<List<SickCirclePublishVo>> findPatientSickCircleList(Integer patientUserId, Integer page, Integer count) {
        List<SickCirclePublishVo> mySickCircleList = sickCircleMapper.findPatientSickCircleList(patientUserId, page, count);
        return HealthR.ok(mySickCircleList);

    }




}
